package extensionTools.smvCreator;

import extensionTools.smvCreator.Exceptions.RulesUtilsException;
import extensionTools.smvCreator.Exceptions.SmvCreatorException;
import extensionTools.smvCreator.Exceptions.SmvDBException;
import extensionTools.smvCreator.Exceptions.SmvInputException;

/**
 * This is an abstact superclass for all rules in the system
 * @author dani
 *
 */
public abstract class Rule{
        
                //db is the diagram database of current operation
                protected DiagramDatabase db;
                /**
                 * This is the constructor for all the rules, it gets the
                 * db element so it would automatically be available for 
                 * all methods.
                 * @param db
                 */
                public Rule(DiagramDatabase db){
                        this.db = db;
                }
                
                /**
         * This function is the main function in the interface.
         * Using this function, SmvCreator gets the String that is
         * the Smv rule.
         * @return the String that holds the case/cases of the rule
                 * @throws SmvDBException 
                 * @throws SmvInputException 
                 * @throws RulesUtilsException 
                 * @throws SmvCreatorException 
         */
        public abstract String createRule() throws SmvInputException, SmvDBException, RulesUtilsException, SmvCreatorException;
}

